
<%@ include file="../common.jsp" %>

<script type="text/javascript">
	$(document).ready(function(){
		bindEventsForDocAttrDtlsPage();
		var docType = '<c:out value="${docDetailsForm.docTypeId}"></c:out>';
		var docStatus = '<c:out value="${currentDocStatus}" />';
		if(docStatus.indexOf("RenewWfip",0) != -1){
			$(".markReadOnly").each(function(index){
				$(this).attr("readonly",true);
			});
		}
		
		/* loadDocCategory(); */
	});
</script>
<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel"><label>Name</label></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:input path="docName" cssClass="markReadOnly text" ></form:input>
		</td>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formLabel"><label>Type</label></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<c:choose>
				<c:when test='${fn:contains(currentDocStatus,"RenewWfip") }'>
					<form:input path="docType" readonly="true" cssClass="text"></form:input>
					<form:hidden path="docTypeId" value="${docDetailsForm.docTypeId}"/>
				</c:when>
				<c:otherwise>
					 <form:select path="docTypeId" id="docTypeID">
							<c:forEach items="${docTypeMap}" var="item">
								<form:option value="${item.key}">${item.value}</form:option>
							</c:forEach>
					</form:select> 
				</c:otherwise>
			</c:choose>
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			<form:errors path="docName" cssClass="errorMsg"></form:errors>
		</td>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			 <form:errors path="docTypeId" cssClass="text errorMsg"></form:errors> 
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr class="formSpacingRow formBlockColor"><td colspan="9"></td></tr>
	<tr>
		<td class="spacingColumnWidthLess" rowspan="4"></td>
		<td class="formLabel" rowspan="4">
			<label>Description</label>
		</td>
		<td class="spacingColumnWidthLess" rowspan="4"></td>
		<td class="formField" rowspan="4">
			<form:textarea path="docDesc" cols="30" rows="3" cssClass="markReadOnly text"></form:textarea>
		</td>
		<td class="spacingColumnWidthMedium" rowspan="3"></td>
		<td class="formLabel"><label>Category</label> </td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<c:choose>
				<c:when test='${fn:contains(currentDocStatus,"RenewWfip") }'>
					<form:input path="docCategory" readonly="true" cssClass="text"></form:input>
					<form:hidden path="docCategoryId" value="${docDetailsForm.docCategoryId}"/>
				</c:when>
				<c:otherwise>
					<form:select path="docCategoryId" id="docCatID">
						<c:forEach items="${docCatList}" var="item">
							<form:option value="${item.dcId}">${item.dcName}</form:option>
						</c:forEach>
					</form:select> 
				</c:otherwise>
			</c:choose>
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr>
		<!-- <td class="spacingColumnWidthLess" ></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
		</td>
		<td class="spacingColumnWidthMedium"></td> -->
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			 <form:errors path="docCategoryId" cssClass="errorMsg"></form:errors> 
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr class="formSpacingRow formBlockColor"><td colspan="4"></td></tr>
	<tr>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formLabel"><label>Sub-Category</label> </td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<c:choose>
				<c:when test='${fn:contains(currentDocStatus,"RenewWfip") }'>
					<form:input path="docSubCategory" readonly="true" cssClass="text"></form:input>
					<form:hidden path="docSubCategoryId" value="${docDetailsForm.docSubCategoryId}"/>
				</c:when>
				<c:otherwise>
					<form:select path="docSubCategoryId" id="docSubCatID">
						<c:forEach items="${docSubCatList}" var="item">
							<form:option value="${item.dscId}">${item.dscName}</form:option>
						</c:forEach>			
					</form:select>
				</c:otherwise>
			</c:choose>
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			<form:errors path="docDesc" cssClass="errorMsg"></form:errors>
		</td>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			 <form:errors path="docSubCategoryId" cssClass="errorMsg"></form:errors>
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
<tr class="formSpacingRow formBlockColor"><td colspan="9"></td></tr>
<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel"><label>Issuing Authority</label></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			<form:textarea path="docIssuingAuthority" cols="30" rows="3" cssClass="text markReadOnly" ></form:textarea>
		</td>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formLabel"><label>Agreement Entered With</label></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formField">
			 <form:textarea path="docEnteredWith" cols="30" rows="3" cssClass="text markReadOnly" /> 
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
	<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			<form:errors path="docIssuingAuthority" cssClass="errorMsg"></form:errors>
		</td>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			 <form:errors path="docEnteredWith" cssClass="text errorMsg"></form:errors> 
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
<tr class="formSpacingRow formBlockColor"><td colspan="9"></td></tr>
<%-- 
	<tr>
		<td>
			<label>Document Name</label>
		</td>
		<td class="spacingColumn"></td>
		<td><form:input path="docName" cssClass="text ui-widget-content ui-corner-all" onkeyup="textCounter(this.id,100);" ></form:input></td>
		<td class="spacingColumn"></td>
		<td>
			<label>Document Description</label>
		</td>
		<td class="spacingColumn"></td>
		<td colspan="5">
			<form:textarea path="docDesc" cssClass="text ui-widget-content ui-corner-all" cols="50" rows="2" onkeyup="textCounter(this.id,200);"></form:textarea>
		</td>
	</tr>
	<tr class="spacingRow"><td></td> </tr>
	<tr>
		<td><label> Document Type*</label></td>
		<td class="spacingColumn"></td>
		<td>
			 <form:select path="docTypeId" id="docTypeID" cssClass="select ui-widget-content ui-corner-all">
				<form:option value="0">Choose Type</form:option>
					<c:forEach items="${docTypeMap}" var="item">
						<form:option value="${item.key}">${item.value}</form:option>
					</c:forEach>
			</form:select> 
		</td>
		<td class="spacingColumn"></td>
		<td><label>Document Category</label> </td>
		<td class="spacingColumn"></td>
		<td>
			 <form:select path="docCategoryId" id="docCatID" cssClass="select ui-widget-content ui-corner-all">
					<c:forEach items="${docCatList}" var="item">
						<form:option value="${item.dcId}">${item.dcName}</form:option>
					</c:forEach>
			</form:select>
		</td> 
		<td class="spacingColumn"></td>
		<td><label>Document Sub-Category</label> </td>
		<td class="spacingColumn"></td>
		<td>
			 <form:select path="docSubCategoryId" id="docSubCatID" cssClass="select ui-widget-content ui-corner-all">
					<c:forEach items="${docSubCatList}" var="item">
						<form:option value="${item.dscId}">${item.dscName}</form:option>
					</c:forEach>
			</form:select>
		</td> 
	</tr>
	<tr>
		<td></td>
		<td class="spacingColumn"></td>
		<td>
			<form:errors path="docTypeId" cssClass="text errorMsg"></form:errors>
		</td>
		<td class="spacingColumn"></td>
		<td></td>
		<td class="spacingColumn"></td>
		<td>
			<form:errors path="docCategoryId" cssClass="text errorMsg"></form:errors>
		</td>
		<td class="spacingColumn"></td>
		<td></td>
		<td class="spacingColumn"></td>
		<td>
			<form:errors path="docSubCategoryId" cssClass="text errorMsg"></form:errors>
		</td>
	</tr>
	<tr class="spacingRow"><td></td></tr> --%>

